<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<KMS.Web.Views.News.AlertViewModel>>" %>
<%@ Import Namespace="KMS.Web.Views.News" %>

<asp:Content ID="Content" ContentPlaceHolderID="TitleContent" runat="server">
    Main Page
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    News
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    
    <%    var dataTemplates = new Dictionary<Type, string>();
          dataTemplates[typeof(SystemAlertViewModel)] = "SystemAlertControl";
          dataTemplates[typeof(ResourceAlertViewModel)] = "ResourceAlertControl"; %>
    
    <table>
        <% foreach (var alert in Model)
           { %>
        <tr>
            <td style="width: 340px">
                <% Html.RenderPartial(dataTemplates[alert.GetType()], alert); %>
            </td>
            <td style="width: 10px">
            </td>
            <td style="vertical-align: top">
                <%= alert.DateTime%>
            </td>
        </tr>
        <tr>
            <td>
                <br />
            </td>
            <td>
            </td>
        </tr>
        <% } %>
    </table>
</asp:Content>
